﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace AME.Repository
{
    /// <summary>
    /// 定义自动审计接口
    /// </summary>
    public interface IDiffLogRepository<T> where T : class, new()
    {
        Task<bool> AddAsync(T entity);
        Task<bool> AddRangeAsync(List<T> entities);
        Task<bool> UpdateAsync(T entity);
        Task<bool> DeleteByIdAsync(object id);
        Task<bool> DeleteAsync(Expression<Func<T, bool>> whereExpression);
        Task<T> GetByIdAsync(object id);
        Task<List<T>> GetListAsync(Expression<Func<T, bool>> whereExpression);
        Task<List<T>> GetAllAsync();
        Task<bool> AnyAsync(Expression<Func<T, bool>> whereExpression);
        Task<T> GetSingleAsync(Expression<Func<T, bool>> whereExpression);
        Task<(List<T> Data, int Total)> GetPagedListAsync(Expression<Func<T, bool>> whereExpression, int pageIndex, int pageSize);
    }
}
